﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleRest.Core;
using SimpleRest.Core.Extensions.Documentation;

namespace SimpleRest.Core.Extensions
{
    public delegate Options DocumentationHandler(Type serviceType, Configuration configuration);

    public class ExtendedConfiguration : Configuration
    {
        public readonly ExtendedConfigurationOptions ExtendedOptions;
        public DocumentationHandler DocumentationHandler { get; set; }

        internal ExtendedConfiguration()
            :base()
        {
            base.MediaTypeFormatters = new List<IMediaTypeFormatter>()
            {
                new Media.XmlMediaTypeFormatter(),
                new Media.JsonMediaTypeFormatter()
            };

            this.ExtendedOptions = new ExtendedConfigurationOptions(this)
            {
                IsDefaultJsonMediaTypeFormatted = false,
                IsDefaultXmlMediaTypeFormatted = false,
                IsXsdFormatted = false
            };
        }

        public bool IsAutoXsdRoutingEnabled { get; set; }
        public bool IsCorrelationHandlerEnabled { get; set; }
        public bool IsAutoServiceDescriptionEnabled { get; set; }
        public bool IsDataAnnotationValidationEnabled { get; set; }
        public bool IsSampleResponseEnabled { get; set; }
    }
}
